package com.dragon.app.commons.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.dragon.loan.entity.AcLoanApplyInfo;
import com.fintech.common.enums.DateFormatEnum;
import com.marvels.common.utils.MarvelsLogUtil;

import cn.hutool.core.util.IdcardUtil;

public class JiaYinJinKApplyLoanDTO  implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private String	productId;	//产品ID	Y	JiaYinJinK
	private String	refOrderId;//渠道申请编号	Y	借款申请唯一编号
	private String	contractNo;//合同编号	Y	
	private String	customerId;//客户编号	Y	
	private String	customerName;//客户名称	Y	
	private String	mobilePhone;//手机号码	Y
	private String	certId;//证件号码	Y	
	private String	nation;//民族	Y	
	private String	idNoAddress;//身份证地址	Y	
	private String	authority;//签发机构	Y	
	private String	idNoValidity;//有效期	Y	19900201-20380701
	/**
	 * 教育程度	Y	"    { ""itemId"": ""3"", ""itemName"": ""大学本科"" },
	    { ""itemId"": ""2"", ""itemName"": ""硕士及以上"" },
	    { ""itemId"": ""1"", ""itemName"": ""博士以上"" },
	    { ""itemId"": ""4"", ""itemName"": ""大学专科"" },
	    { ""itemId"": ""5"", ""itemName"": ""高中及以下"" },
	    { ""itemId"": ""6"", ""itemName"": ""中专/中等技校"" },
	    { ""itemId"": ""7"", ""itemName"": ""初中"" },
	    { ""itemId"": ""8"", ""itemName"": ""小学及以下"" }"
	 */
	private String	education;
	/**
	 * 婚姻类型	Y	"   { ""itemId"": ""1"", ""itemName"": ""未婚"" },
	    { ""itemId"": ""2"", ""itemName"": ""已婚"" },
	    { ""itemId"": ""3"", ""itemName"": ""离异"" },
	    { ""itemId"": ""4"", ""itemName"": ""丧偶"" },
	    { ""itemId"": ""5"", ""itemName"": ""其他"" }"
	 */
	private String	marriages;
	private String	hasChild;//是否有小孩	N	1,有 0,无
	/**
	 * 居住类型		"    { ""itemId"": ""A001"", ""itemName"": ""无按揭房"" },
	    { ""itemId"": ""A002"", ""itemName"": ""按揭房"" },
	    { ""itemId"": ""A003"", ""itemName"": ""自建房"" },
	    { ""itemId"": ""A004"", ""itemName"": ""亲属房"" },
	    { ""itemId"": ""A005"", ""itemName"": ""集体宿舍"" },
	    { ""itemId"": ""A006"", ""itemName"": ""共有住宅"" },
	    { ""itemId"": ""A009"", ""itemName"": ""自有住房"" },
	    { ""itemId"": ""A007"", ""itemName"": ""租赁住房"" },
	    { ""itemId"": ""A008"", ""itemName"": ""其他"" },"
	 */
	private String	liveType;
	//现居地址省份code	Y	地址编码表
	private String	provinceId;
	private String	provinceName;//现居地址省份	Y	
	private String	cityId;//现居地址城市code	Y	地址编码表
	private String	cityName;//现居地址城市	Y	
	private String	areaId;//现居地址区code	Y	地址编码表
	private String	areaName;//现居地址区	Y	
	private String	address;//现居详细地址	Y
	private String	companyName;//公司名称	Y
	/**
	 * 公司类型	Y	"1 国企
	2 私企
	3 个体
	4 股份
	5 事业单位
	6 其他"
	 */
	private String	companyType;
	/**
	 * 岗位类型	Y	"1 普通员工
	2 部门负责人
	3 单位负责人
	 */
	private String	positionType;
	private String	companyProvinceId;//公司地址省份code	Y	地址编码表
	private String	companyProvinceName;//公司地址省份	Y	
	private String	companyCityId;//公司地址城市code	Y	地址编码表
	private String	companyCityName;//公司地址城市	Y	
	private String	companyAreaId;//公司地址区code	Y	地址编码表
	private String	companyAreaName;//公司地址区	Y	
	private String	companyAddress;//公司详细地址	Y	
	
	/**
	 * 月收入	Y	"    { ""itemId"": ""C001"", ""itemName"": ""2000元以下"" },
	    { ""itemId"": ""C002"", ""itemName"": ""2000-3000元"" },
	    { ""itemId"": ""C003"", ""itemName"": ""3001-5000元"" },
	    { ""itemId"": ""C004"", ""itemName"": ""5001-8000元"" },
	    { ""itemId"": ""C005"", ""itemName"": ""8001-12000元"" },
	    { ""itemId"": ""C006"", ""itemName"": ""12001-15000元"" },
	    { ""itemId"": ""C007"", ""itemName"": ""15001-18000元"" },
	    { ""itemId"": ""C008"", ""itemName"": ""18000-20000元"" },
	    { ""itemId"": ""C009"", ""itemName"": ""20000元以上"" }"
	 */
	private String	monthIncome;
	
	private String	officeTel;//办公电话	N	
	/**
	 * 工作年限	Y	"    { ""itemId"": ""1"", ""itemName"": ""3个月以下-不含试用期"" },
	    { ""itemId"": ""2"", ""itemName"": ""3个月-1年"" },
	    { ""itemId"": ""3"", ""itemName"": ""1年-3年"" },
	    { ""itemId"": ""4"", ""itemName"": ""3年-5年"" },
	    { ""itemId"": ""9"", ""itemName"": ""5年以上"" }"
	 */
	private String	workYear;
	private String	employeeType;//雇佣类型	Y	0自雇，1授薪,2自由职业者
	private BigDecimal	applyMoney;	//申请金额	Y
	private BigDecimal	loanMoneyAct;//核定金额	Y	
	private String	applyTime;//申请时间	Y	yyyy/MM/dd hh:mm:ss
	private String	inChannel;//进件渠道	Y	
	private String	inCity;//进件城市	Y
	private String	custType;//客户类型	Y	01,个人 02,企业
	private int	sex;//性别	N	0男,1女
	private String	creditLvl;//模型等级	Y	A、B、C、D
	/**
	 * 还款方式	Y	"01-随借随还
	02-等额本息
	03-等额本金
	04-每月还息和费，到期还本
	05-自定义还款计划的分期还款"
	 */
	private String	rtnType;//借款期数	Y	1,3,6,9
	private int	loanPeriod;//借款期限	Y	30,45,60
	private int	termUnit;//期限单位	Y	"1-月2-日"
	private int	loanTerm;
	/**
	 * 借款用途	Y	"1.购物
	2.装修
	3.旅游
	4.教育
	5.租赁
	6.经营周转
	7.其他	
	 */
	private int	loanUse;
	
	private String	repayBank;	//还款账户开户行	Y	银行编码（详细见银行编码表）
	private String	repayAcctName;//还款帐户名	Y	
	private String	repayCardNo;//还款帐户名	Y
	private String	repayMobileNo;//还款账号	Y
	private String	receiveBank;//还款银行卡预留手机号码	Y	
	private String	receiveAcctName;//放款款账户开户行	Y	银行编码（详细见银行编码表）
	private String	receiveCardNo;//放款帐户名	Y
	private String	receiveMobileNo;//放款银行卡预留手机号码	Y	
	private List<JiaYinJinKContactDTO> contactList;
	
	
	
	
	public static AcLoanApplyInfo getAcLoanApplyInfo(JiaYinJinKApplyLoanDTO jiaYinJinKApplyLoanDTO) {
		AcLoanApplyInfo acLoanApplyInfo = new AcLoanApplyInfo();
		acLoanApplyInfo.setProductTypeName("");
		acLoanApplyInfo.setProductName("");
		acLoanApplyInfo.setApplyTerms(jiaYinJinKApplyLoanDTO.getLoanTerm());
		acLoanApplyInfo.setApplyMoney(jiaYinJinKApplyLoanDTO.getApplyMoney());
		acLoanApplyInfo.setReferrerMobileNum("");
		acLoanApplyInfo.setUsedId(jiaYinJinKApplyLoanDTO.getLoanUse()+"");
		acLoanApplyInfo.setUsedName(jiaYinJinKApplyLoanDTO.getLoanUse()+"");
		acLoanApplyInfo.setReceiveBankName(jiaYinJinKApplyLoanDTO.getReceiveBank());
		acLoanApplyInfo.setRepayBankName(jiaYinJinKApplyLoanDTO.getRepayBank());
		acLoanApplyInfo.setRepayAcctName(jiaYinJinKApplyLoanDTO.getReceiveAcctName());
		acLoanApplyInfo.setRepayAcct(jiaYinJinKApplyLoanDTO.getRepayCardNo());
		acLoanApplyInfo.setReceiveAcct(jiaYinJinKApplyLoanDTO.getReceiveCardNo());
		acLoanApplyInfo.setReceiveAcctName(jiaYinJinKApplyLoanDTO.getReceiveAcctName());
		
		// 填充实名验证的数据
		acLoanApplyInfo.setUserId("");
		acLoanApplyInfo.setCustIdCard(jiaYinJinKApplyLoanDTO.getCertId());
		acLoanApplyInfo.setCustName(jiaYinJinKApplyLoanDTO.getCustomerName());
		acLoanApplyInfo.setIdCardAddress(jiaYinJinKApplyLoanDTO.getIdNoAddress());
		acLoanApplyInfo.setNationality(jiaYinJinKApplyLoanDTO.getNation());
		Date startvDate = 
				com.fintech.common.util.DateTimeUtil.formatStrDate(DateFormatEnum.yyyyMMdd, 
						jiaYinJinKApplyLoanDTO.getIdNoValidity().substring(0, 8));

		Date endvDate = 
				com.fintech.common.util.DateTimeUtil.formatStrDate(DateFormatEnum.yyyyMMdd, 
						jiaYinJinKApplyLoanDTO.getIdNoValidity().substring(9));


		acLoanApplyInfo.setIdCardValidDate(startvDate);
		acLoanApplyInfo.setIdCardValidEndDate(endvDate);
		acLoanApplyInfo.setCertificateAuthority(jiaYinJinKApplyLoanDTO.getAuthority());
		Integer sex = jiaYinJinKApplyLoanDTO.getSex();
		String identityCardNo = jiaYinJinKApplyLoanDTO.getCertId();
		acLoanApplyInfo.setSex(sex == null ? "" : sex + "");
		Date birthDate = com.fintech.common.util.DateTimeUtil.formatStrDate(DateFormatEnum.yyyyMMdd, identityCardNo.substring(6, 14));
		acLoanApplyInfo.setBirthDate(birthDate);
		try {
			acLoanApplyInfo.setAge(com.fintech.common.util.DateTimeUtil.getAge(birthDate));
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("===========setAge=================", e);
		}
		return acLoanApplyInfo;
	}
	
	
	
	
	public String getProductId() {
		return productId;
	}
	public void setProductId(String productId) {
		this.productId = productId;
	}
	public String getRefOrderId() {
		return refOrderId;
	}
	public void setRefOrderId(String refOrderId) {
		this.refOrderId = refOrderId;
	}
	public String getContractNo() {
		return contractNo;
	}
	public void setContractNo(String contractNo) {
		this.contractNo = contractNo;
	}
	public String getCustomerId() {
		return customerId;
	}
	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	public String getCustomerName() {
		return customerName;
	}
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
	public String getMobilePhone() {
		return mobilePhone;
	}
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}
	public String getCertId() {
		return certId;
	}
	public void setCertId(String certId) {
		this.certId = certId;
	}
	public String getNation() {
		return nation;
	}
	public void setNation(String nation) {
		this.nation = nation;
	}
	public String getIdNoAddress() {
		return idNoAddress;
	}
	public void setIdNoAddress(String idNoAddress) {
		this.idNoAddress = idNoAddress;
	}
	public String getAuthority() {
		return authority;
	}
	public void setAuthority(String authority) {
		this.authority = authority;
	}
	public String getIdNoValidity() {
		return idNoValidity;
	}
	public void setIdNoValidity(String idNoValidity) {
		this.idNoValidity = idNoValidity;
	}
	public String getEducation() {
		return education;
	}
	public void setEducation(String education) {
		this.education = education;
	}
	public String getMarriages() {
		return marriages;
	}
	public void setMarriages(String marriages) {
		this.marriages = marriages;
	}
	public String getHasChild() {
		return hasChild;
	}
	public void setHasChild(String hasChild) {
		this.hasChild = hasChild;
	}
	public String getLiveType() {
		return liveType;
	}
	public void setLiveType(String liveType) {
		this.liveType = liveType;
	}
	public String getProvinceId() {
		return provinceId;
	}
	public void setProvinceId(String provinceId) {
		this.provinceId = provinceId;
	}
	public String getProvinceName() {
		return provinceName;
	}
	public void setProvinceName(String provinceName) {
		this.provinceName = provinceName;
	}
	public String getCityId() {
		return cityId;
	}
	public void setCityId(String cityId) {
		this.cityId = cityId;
	}
	public String getCityName() {
		return cityName;
	}
	public void setCityName(String cityName) {
		this.cityName = cityName;
	}
	public String getAreaId() {
		return areaId;
	}
	public void setAreaId(String areaId) {
		this.areaId = areaId;
	}
	public String getAreaName() {
		return areaName;
	}
	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getCompanyName() {
		return companyName;
	}
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	public String getCompanyType() {
		return companyType;
	}
	public void setCompanyType(String companyType) {
		this.companyType = companyType;
	}
	public String getPositionType() {
		return positionType;
	}
	public void setPositionType(String positionType) {
		this.positionType = positionType;
	}
	public String getCompanyProvinceId() {
		return companyProvinceId;
	}
	public void setCompanyProvinceId(String companyProvinceId) {
		this.companyProvinceId = companyProvinceId;
	}
	public String getCompanyProvinceName() {
		return companyProvinceName;
	}
	public void setCompanyProvinceName(String companyProvinceName) {
		this.companyProvinceName = companyProvinceName;
	}
	public String getCompanyCityId() {
		return companyCityId;
	}
	public void setCompanyCityId(String companyCityId) {
		this.companyCityId = companyCityId;
	}
	public String getCompanyCityName() {
		return companyCityName;
	}
	public void setCompanyCityName(String companyCityName) {
		this.companyCityName = companyCityName;
	}
	public String getCompanyAreaId() {
		return companyAreaId;
	}
	public void setCompanyAreaId(String companyAreaId) {
		this.companyAreaId = companyAreaId;
	}
	public String getCompanyAreaName() {
		return companyAreaName;
	}
	public void setCompanyAreaName(String companyAreaName) {
		this.companyAreaName = companyAreaName;
	}
	public String getCompanyAddress() {
		return companyAddress;
	}
	public void setCompanyAddress(String companyAddress) {
		this.companyAddress = companyAddress;
	}
	public String getMonthIncome() {
		return monthIncome;
	}
	public void setMonthIncome(String monthIncome) {
		this.monthIncome = monthIncome;
	}
	public String getOfficeTel() {
		return officeTel;
	}
	public void setOfficeTel(String officeTel) {
		this.officeTel = officeTel;
	}
	public String getWorkYear() {
		return workYear;
	}
	public void setWorkYear(String workYear) {
		this.workYear = workYear;
	}
	public String getEmployeeType() {
		return employeeType;
	}
	public void setEmployeeType(String employeeType) {
		this.employeeType = employeeType;
	}
	public BigDecimal getApplyMoney() {
		return applyMoney;
	}
	public void setApplyMoney(BigDecimal applyMoney) {
		this.applyMoney = applyMoney;
	}
	public BigDecimal getLoanMoneyAct() {
		return loanMoneyAct;
	}
	public void setLoanMoneyAct(BigDecimal loanMoneyAct) {
		this.loanMoneyAct = loanMoneyAct;
	}
	public String getApplyTime() {
		return applyTime;
	}
	public void setApplyTime(String applyTime) {
		this.applyTime = applyTime;
	}
	public String getInChannel() {
		return inChannel;
	}
	public void setInChannel(String inChannel) {
		this.inChannel = inChannel;
	}
	public String getInCity() {
		return inCity;
	}
	public void setInCity(String inCity) {
		this.inCity = inCity;
	}
	public String getCustType() {
		return custType;
	}
	public void setCustType(String custType) {
		this.custType = custType;
	}
	public int getSex() {
		return sex;
	}
	public void setSex(int sex) {
		this.sex = sex;
	}
	public String getCreditLvl() {
		return creditLvl;
	}
	public void setCreditLvl(String creditLvl) {
		this.creditLvl = creditLvl;
	}
	public String getRtnType() {
		return rtnType;
	}
	public void setRtnType(String rtnType) {
		this.rtnType = rtnType;
	}
	public int getLoanPeriod() {
		return loanPeriod;
	}
	public void setLoanPeriod(int loanPeriod) {
		this.loanPeriod = loanPeriod;
	}
	public int getTermUnit() {
		return termUnit;
	}
	public void setTermUnit(int termUnit) {
		this.termUnit = termUnit;
	}
	public int getLoanTerm() {
		return loanTerm;
	}
	public void setLoanTerm(int loanTerm) {
		this.loanTerm = loanTerm;
	}
	public int getLoanUse() {
		return loanUse;
	}
	public void setLoanUse(int loanUse) {
		this.loanUse = loanUse;
	}
	public String getRepayBank() {
		return repayBank;
	}
	public void setRepayBank(String repayBank) {
		this.repayBank = repayBank;
	}
	public String getRepayAcctName() {
		return repayAcctName;
	}
	public void setRepayAcctName(String repayAcctName) {
		this.repayAcctName = repayAcctName;
	}
	public String getRepayCardNo() {
		return repayCardNo;
	}
	public void setRepayCardNo(String repayCardNo) {
		this.repayCardNo = repayCardNo;
	}
	public String getRepayMobileNo() {
		return repayMobileNo;
	}
	public void setRepayMobileNo(String repayMobileNo) {
		this.repayMobileNo = repayMobileNo;
	}
	public String getReceiveBank() {
		return receiveBank;
	}
	public void setReceiveBank(String receiveBank) {
		this.receiveBank = receiveBank;
	}
	public String getReceiveAcctName() {
		return receiveAcctName;
	}
	public void setReceiveAcctName(String receiveAcctName) {
		this.receiveAcctName = receiveAcctName;
	}
	public String getReceiveCardNo() {
		return receiveCardNo;
	}
	public void setReceiveCardNo(String receiveCardNo) {
		this.receiveCardNo = receiveCardNo;
	}
	public String getReceiveMobileNo() {
		return receiveMobileNo;
	}
	public void setReceiveMobileNo(String receiveMobileNo) {
		this.receiveMobileNo = receiveMobileNo;
	}
	public List<JiaYinJinKContactDTO> getContactList() {
		return contactList;
	}
	public void setContactList(List<JiaYinJinKContactDTO> contactList) {
		this.contactList = contactList;
	}
	
}
